Tourist Bowling - A Pygame Side-Scroller¶
This game is an endless runner in a side-scroller-like format, in which the goal is to break the highscore. You get points by surviving as long as possible, and managing to avoid the different obstacles during a run.
When starting the game (see installation process below) you are introduced to the homescreen. To start the game you have to press "SPACE", as indicated on the screen.
Gameplay¶
The mechanics of this game are fairly simple, you press the UP-arrow to navigate the player upwards and the DOWN-arrow, to navigate downwards. Horizontal movement is automatic and will get faster, the further you progress in the game (i.e. the higher your score is). Obstacles will also spawn closer together, the further you get in the game and harder obstacles will spawn with higher frequency (i.e. the local) You lose the game (game over) when the player hits any of the obstacles. (see below)
The Lanes¶
These are the three lanes (i.e. the two bike-lanes and the sidewalk) between which you can switch and on which obstacles will spawn.
Obstacles will never cross the lanes.
The Obstacles:¶
The Pothole¶
The pothole is the most common obstacle and will spawn on either one of the two bike-lanes
Construction Site¶
The construction site is a stationary obstacle and can only spawn on the bikelane.
It is the only obstacle that covers two lanes.
While in the gamecode, the construction site is currently not being spawned, as there
can be instances when all lanes are blocked due to the random spawning.
Construction Site will be back as soons as the spawn system is tweaked (see planned features below).
Tourist¶
The tourist only spawns on the sidewalk and the right side of the screen and moves towards the left side of the screen.
The tourist will die when being hit by the escooter
E-biker¶
The E-biker is the hardest obstacle in the game and is most likely to spawn when a lane (i.e the two bikepaths) is free.
It will never spawn on the sidewalk.
It can either spawn on the left or right side of the screen and moves faster when spawning on the left side of the screen
The E-biker will also die when hitting an obstacle other than the player
Escooter¶
The escooter will spawn on the right side of the screen and will always move to the left side (towards the player) and will always spawn on the sidewalk
The E-scooter will die when colliding with the bikestand but not with the tourist
Bikestand¶
The bikestand is a stationary obstacle and only spawns on the sidewalk
Obstacle Spawning¶
All obstacles will be spawned with a delay from 600 - 800ms. That is more likely to be higher in the beginning of the game. All obstacles are spawned randomly, except the local, who is more likely to appear if a given lane is free of other obstacles.
Game-Over¶
When the player hits any of the obstacles mentioned above, the game is over.
The Score will be displayed in the upper-right corner of the screen.
To restart the game, press SPACE again and the game will start immediately.
Installing the Game¶
The game-repository is available under: https://github.com/Programming-The-Next-Step-2025/cycling-game.git
Step-By-Step Installation¶
Step 0¶
Clone the repository in your terminal with:
git clone https://github.com/Programming-The-Next-Step-2025/cycling-game.git your_folder_name
Alternatively, you can clone the repository using GitHub Desktop:
Step 1¶
Once cloned, you can navigate to the directory you have created (e.g. cycling_game)
Next, navigate to the "Executables" folder and select the subfolder with the name of your operating system.
(GNU) Linux is not supported at this stage of development
cd path/to/your/game_directory/Executables/SELECT/YOUR/OS
open Tourist_Bowling.app #.app only on MacOS; Select the .exe file when using Windows
Bypassing the Gatekeeper on MacOS:¶
To open the game.app file when the OS is complaining you have to:
- Go to System Settings --> Privacy & Security
- Scroll down to see a security message
- Click on Open anyways
Bypassing the Firewall on Windows¶
After opening the .exe file the firewall should complain and you should click on "more information" and "open anyways" (No screenshots can be provided for a lack of a Windows machine).
Alternatively, you can navigate to the game directory using your graphical user interface. Next, select the directory for your operating system and double-click (execute) the .app file on MacOS or the .exe file on Windows machines.
Should your operating system (OS) complain about the trustwhorthiness of the file, right-click on the file and select "run as admin" (Windows). Should this not be enough, try disabling the firewall for this. or "Open" (MacOS)
Please note that this game has been programmed and interpreted on MacOS and only partially tested on Windows. Should the .exe file not work please see manual installation process below.
Please note that due to a mistake when packaging the Windows .exe, the highscore system is not properly working on that OS. This will be fixed in the future!
Should you run into any issues, or want to report a bug, during the installation process you can reach the dev at felix_hofer@gmx.de (see README)
Manual Installation (OS independent)¶
In case you want to develop the game further, you can manually install the related package:
Please check the .toml or the README file for necessary dependencies!
It is recommended to create a new conda environment for this, to ensure all dependencies work with each other on the correct version.
Once you have cloned the repository, you can navigate to it and then install the package with:
This part is optional if you want to create a virtual environment for this (adviced)
This part assumes you have conda installed
conda create --name cycling-env python=3.10
conda activate cycling-env
cd path/to/your/game_directory
pip install -e .
pip install -r requirements.txt #Optional but adviced to ensure pygame installation
This should install the package locally on your system. Next, you can navigate to:
cd src/cycling_game
And then run the game with:
python run.py
Running using the package function (IN DEVELOPMENT)¶
This is a planned feature and as of now not fully functional!
After cloning and installing the package (see steps above),
It is possible to run the game by typing
cycling_game_run
in the terminal.
As of now this only works in the VS-Code (IDE) terminal because it automatically sets the python-path.
In the general terminal, after installing you can try:
cycling_game_run
Should this not work, make sure your working directory is set to the root of the game repository and try:
export PYTHONPATH="/Path/to/your/repository/cycling-game/src:$PYTHONPATH" # MacOS ONLY!
set PYTHONPATH=C:\Path\to\your\repository\cycling-game\src;%PYTHONPATH% # Should work on Windows (cmd.exe only!)
# Please note that this has not been tested on Windows yet!
After this, you should be able to run the game with:
cycling_game_run
Note, that the terminal has to stay open to run the game!
Planned Features¶
- Power-up system
- Slow down mechanics (Hit the brakes for a short period to avoid moving obstacles)
- Pattern based obstacle spawning (instead of pseudorandom)
If you have any ideas for more content, please send me an e-mail or create a pull request.
Contact¶
You can reach the developer at felix_hofer@gmx.de
In case of any suggestions for future features, a pull request on the GitHub repository will me much appreaciated!